package sktit.practice.jpaint.canvas;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;

import sktit.practice.jpaint.shape.Ellipse;
import sktit.practice.jpaint.shape.Shape;

public class EllipseCanvas extends AbstractCanvas {

	public EllipseCanvas(GC aGC, Shape aShape) {
		super(aGC, aShape);
	}

	public void draw()
	{
		Ellipse e = (Ellipse)shape;
		gc.drawOval(e.getVertex().x, e.getVertex().y, e.getWidth(), e.getHeight());
	}
	
	public void fill(Color color)
	{
		gc.setBackground(color);
		Ellipse e = (Ellipse)shape;
		gc.fillOval(e.getVertex().x, e.getVertex().y, e.getWidth(), e.getHeight());
	}
	
}
